package com.sample.base.rxjava;

import android.content.Context;
import android.graphics.Bitmap;

import com.loyal.rx3.BaseRxSubscriber;
import com.loyal.rx3.RetroManager;
import com.sample.base.ImageUtil;

import io.reactivex.rxjava3.core.Observable;

public class RxJavaTaskSubscriber<T> extends BaseRxSubscriber<T> implements TaskImpl {

    @Override
    public void createServer(RetroManager manager) {

    }

    public RxJavaTaskSubscriber(Context context) {
        super(context);
    }

    @Override
    public Observable<String> saveBmp(final String savePath, final Bitmap bitmap) {
        return Observable.just(savePath).
                map(path -> ImageUtil.saveBitmap(savePath, bitmap));
    }
}

